<html>
<head><meta charset="utf-8"><title>Queries in rustc_query_system · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Queries.20in.20rustc_query_system.html">Queries in rustc_query_system</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224670765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Queries%20in%20rustc_query_system/near/224670765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Queries.20in.20rustc_query_system.html#224670765">(Jan 31 2021 at 22:56)</a>:</h4>
<p><span class="user-mention" data-user-id="200368">@Julian-Wollersberger</span>, to avoid polluting <a href="https://github.com/rust-lang/rust/issues/81609">#81609</a>.</p>
<blockquote>
<p>I believe it wouldn't have any impact, just that the macro_rules! produced by the query proc macro must be imported from a different path. My plan is to move just the query definitions and the DepKind enum. The rest depends to much on rustc_middle.<br>
That might enable it that a bunch of generic bounds on the DepKind trait could be removed, but I've tried around quite a bit and it seems to not work out thanks to DepKind::debug_node(). So I'll probably have to give up on that.</p>
</blockquote>
<p><code>DepKind::debug_node</code> is a debugging operation. You can get away with using a callback: see <code>rustc_interface::callbacks</code>. It's ugly, but it does the job.</p>
<blockquote>
<p>The original goal was to prevent the query system from being monomorphized for every single query kind. Maybe I can find a different way. Any ideas?</p>
</blockquote>
<p>I don't have a lot. The monomorphizations due to the different queries come from the triplet (Key, Value, Cache). Some parts of the query plumbing only really depend on Key, and are generic on Value just to return the result. I haven't really found a way around.</p>



<a name="224710747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Queries%20in%20rustc_query_system/near/224710747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julian-Wollersberger <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Queries.20in.20rustc_query_system.html#224710747">(Feb 01 2021 at 11:02)</a>:</h4>
<p>Didn't know about those callbacks, thanks.</p>
<p>Ok, that confirms my suspicions about what is monomorphized.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>